package edu.biwu.controller;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class HelloController implements Controller {
//    @Override
//    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
//        ModelAndView modelAndView = new ModelAndView();
//        modelAndView.setViewName("index");//最终路径:视图解析器中配置的前缀+viewName+后缀
//                                         //"/WEB-INF/views/" + "index" + ".html"
//        return modelAndView;
//    }

    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("index");//最终路径:视图解析器中配置的前缀+viewName+后缀
                                         //"/WEB-INF/views/" + "index" + ".html"
        return modelAndView;

    }
}
